#include <iostream>
using std::cout;
using std::endl;

class Line
{
public:
    class Point{
    public:
        Point(int x,int y)
        : _ix(x)
        , _iy(y)
        {}
        
        friend class Line;
    private:
        void print() const{
            cout << "(" << _ix
                << "," << _iy
                << ")";
        }
    
        static void show(){
            cout << "Point::show()" << endl;
        }

        void display() const{
            Line::test();
            test();
        }

        void getll(const Line & rhs){
            cout << rhs._length << endl;
            rhs.printLine();
        }
        int _ix;
        int _iy;
    };
public:
    Line(int x1, int y1, int x2, int y2)
    : _pt1(x1,y1)
    , _pt2(x2,y2)
    {}

private: 
    void printLine() const{
        /* _pt1.print(); */
        Point::show();
        /* show(); */
    }

    static void test(){
        cout << "Line::test()" << endl;
    }

    Point _pt1;
    Point _pt2;
    double _length = 10;
};

void test0(){
    Line ll(1,2,3,4);
    //内部类创建对象时要加上外部类的作用域
    //如果内部类定义在外部类的私有区域
    //则无法在外部类之外创建内部类对象
    Line::Point pt(8,9);

    cout << sizeof(pt) << endl;
    cout << sizeof(ll) << endl;

}

int main(void){
    test0();
    return 0;
}
